import requests from "./requests";



export const getUser = ()=>
    ({
    url:'/user'
})
export const registerUser = (data)=>requests({
  method: "post",
  url:'/user/register',
  data:data
})

export const userLogin = (data)=>requests({
    method: "post",
    url:'/user/login',
    data:data
})

export const getGoods = ()=>requests({
    method: "get",
    url:'/goods',
})
export const getGoodsCart = (userId)=>requests({
    method: "get",
    url:'/shoppingCart/'+userId,
    
})
export const addGoodsCart = (data)=>requests({
    method: "post",
    url:'/shoppingCart',
    data:data
})
//清空购物车接口
export const delAllShop = (userId)=>requests({
    method: "delete",
    url:'/shoppingCart/delAll/'+userId,
})
//删除单个购物车商品接口
export const delSingleShop = (goosId)=>requests({
    method: "delete",
    url:'/shoppingCart/'+goosId,
})
//新增商品和修改用户购买商品数
export const updateCount = (data)=>requests({
    method: "delete",
    url:'/shoppingCart/del/batch',
    data:data
})
//修改密码
export const upPassowrd = (data)=>requests({
    method: "delete",///////////////
    url:'',///////////////////
    data:data
})
//根据id查询商品
export const getGoodsById = (goodsId)=>requests({
    method: "get",
    url:'/goods/'+goodsId,
    
})